private ["_unit","_claw","_ui","_hud"];
disableSerialization;

sleep 3;

_clawcooldown=0;
_bandagecooldown=0;
_meatcooldown=0;

while {true} do {
	_unit=if (!isNil {player getVariable "spectating"}) then {player getVariable "spectating"} else {player};
	waitUntil {!CLY_cutscene};

//Claws
	if (damage _unit>0.28 and time>_clawcooldown) then {
		4 cutRsc ["clawhud","PLAIN"];
		_ui=uiNamespace getVariable "clawhud";
		_hud=_ui displayCtrl 23500;
		_hud ctrlSetPosition [safeZoneX,safeZoneY+safeZoneH-0.08];
		_claw="";
		if (damage _unit>0.28) then {_claw="zombie_scripts\claw1.paa"};
		if (damage _unit>0.59) then {_claw="zombie_scripts\claw2.paa"};
		if (damage _unit>0.9) then {_claw="zombie_scripts\claw3.paa"};
		_hud ctrlSetText _claw;
		_hud ctrlCommit 0;
		_clawcooldown=time+0.49;
	};

//Bandagens
	if (!isNil {_unit getVariable "CLY_healings"} and time>_bandagecooldown) then {
		_bandages=_unit getVariable "CLY_healings";
		if (_bandages>=0) then {
			3 cutRsc ["bandagehud","PLAIN"];
			_ui=uiNamespace getVariable "bandagehud";
			_hud=_ui displayCtrl 23500;
			_hud ctrlSetPosition [safeZoneX+0.06,safeZoneY+safeZoneH-0.02];
			_hud ctrlSetText format ["Bandages: %1",_bandages];
			_hud ctrlCommit 0;
			_bandagecooldown=time+0.45;
		};
	};
/*
//Meat
	if (!isNil {_unit getVariable "CLY_meats"} and time>_meatcooldown) then {
		_meats=_unit getVariable "CLY_meats";
		if (_meats>=0) then {
			2 cutRsc ["meathud","PLAIN"];
			_ui=uiNamespace getVariable "meathud";
			_hud=_ui displayCtrl 23500;
			_hud ctrlSetPosition [safeZoneX+0.20,safeZoneY+safeZoneH-0.02];
			_hud ctrlSetText format ["Meats: %1",_meats];
			_hud ctrlCommit 0;
			_meatcooldown=time+0.45;
		};
	};
*/

	sleep 0.02;
};